﻿@using CollegeShop.Infrastructure.Entities.Enum
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Staff.cshtml";
}
<div class="main-content" style="margin-left: 190px;">
    <div class="breadcrumbs" id="breadcrumbs">
        <ul class="breadcrumb">
            <li><i class="icon-home home-icon"></i><a href="/staff/index">管理控制台</a> </li>
            <li class="active">管理首页</li>
        </ul>
        <!-- .breadcrumb -->
    </div>
    <div class="page-content">
        <div class="page-header">
            <h1>
                @{
                    CollegeShop.Infrastructure.Entities.Entity.User user = ViewBag.ManagerTitle;
                    if(user!= null && user.SalesUnit != null)
                    {
                        @:@(user.SalesUnit.SalesUnitName)
                    }
                    }<small><i class="icon-double-angle-right"></i> 销售管理控制台
                 </small>
            </h1>
        </div>
        <!-- /.page-header -->
        <div class="row" style="margin-left: 20px;">
            <div class="widget-box transparent" id="recent-box">
            <div class="widget-header">
                <h4 class="lighter smaller">
                    <i class="icon-reorder orange"></i>待处理订单
                </h4>
                <div class="widget-toolbar no-border">
					<a href="javascript:;"><button class="btn btn-minier btn-primary ">
						更多订单
						<i class="icon-angle-right icon-on-right bigger-110"></i>
					</button></a>
				</div>
            </div>
            <div class="widget-main no-padding">
                <table class="table table-bordered table-striped">
                    <thead class="thin-border-bottom">
                        <tr>
                            <th width="8%">
                                <i class="icon-caret-right blue"></i>客户
                            </th>
                            <th width="40%">
                                <i class="icon-caret-right blue"></i>购买商品
                            </th>
                            <th width="12%">
                                <i class="icon-caret-right blue"></i>订单状态
                            </th>
                            <th width="15%">
                                <i class="icon-caret-right blue"></i>订单时间
                            </th>
                            <th width="12%">
                                <i class="icon-caret-right blue"></i>价格
                            </th>
                            <th class="hidden-480">
                                <i class="icon-caret-right blue"></i>操作
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                    @{
                        List<CollegeShop.Infrastructure.Entities.Entity.Order> pendingOrder = ViewBag.PendingOrder;
                        if(pendingOrder != null && pendingOrder.Any()){
                            foreach(var item in pendingOrder)
                            {
                            <tr>
                                <td>
                                    @item.LinkMan
                                </td>
                                <td>
                                    @Html.Raw(item.GoodsDescript)
                                </td>
                                <td>
                                    <i class="icon-bell orange"></i> <span class="orange">@item.State.Mapping()</span>
                                </td>
                                <td>
                                    @{int pendingTime =DateTime.Now.Subtract(item.OrderTime).Days * 60 * 24 +
                                      DateTime.Now.Subtract(item.OrderTime).Hours * 60 + DateTime.Now.Subtract(item.OrderTime).Minutes;
                                      if (pendingTime <= 5)
                                    {
                                        <span class="green">@item.OrderTime.ToString("yyyy-MM-dd HH:mm")</span>
                                    }
                                    else if(pendingTime <= 8)
                                    {
                                      <span class="orange">@item.OrderTime.ToString("yyyy-MM-dd HH:mm")</span>
                                    }
                                    else
                                    {
                                        <span class="red bolder">@item.OrderTime.ToString("yyyy-MM-dd HH:mm")</span>
                                    }
                                    }
                                </td>
                                <td class="hidden-480">
                                    <b class="green">RMB：@item.TotalMoney</b>
                                </td>
                                <td>
                                    <input type="button" class="btn btn-success btn-mini" value="交易成功" />
                                    <input type="button" class="btn btn-warning btn-mini" value="交易取消" />
                                </td>
                            </tr>
                            }
                        }
                        else
                        {
                        <tr>
                            <td colspan="6">
                                暂无订单
                            </td>
                        </tr>
                        }
                        }
                        
                    </tbody>
                </table>
            </div>
            </div>
            <!-- /.col -->
            <div class="hr hr32 hr-dotted">
            </div>
            <div class="widget-box transparent" id="recent-box">
                <div class="widget-header">
                    <h4 class="lighter smaller">
                        <i class="icon-th orange"></i>仓储概况
                    </h4>
                    <div class="widget-toolbar no-border">
                        <ul class="nav nav-tabs" id="recent-tab">
                            <li class="active"><a data-toggle="tab" href="#task-tab">单品警戒值</a> </li>
                            <li><a data-toggle="tab" href="#member-tab">在配送货品</a> </li>
                        </ul>
                    </div>
                </div>
                <div class="widget-body">
                    <div class="widget-main padding-4">
                        <div class="tab-content padding-8 overflow-visible">
                            <div id="task-tab" class="tab-pane active">
                                <ul id="tasks" class="item-list">
                                    <li class="item-orange clearfix">
                                        <label class="inline">
                                            <input type="checkbox" class="ace">
                                            <span class="lbl">Answering customer questions</span>
                                        </label>
                                        <div class="pull-right easy-pie-chart percentage" data-size="30" data-color="#ECCB71"
                                            data-percent="42">
                                            <span class="percent">42</span>%
                                        </div>
                                    </li>
                                    <li class="item-red clearfix">
                                        <label class="inline">
                                            <input type="checkbox" class="ace">
                                            <span class="lbl">Fixing bugs</span>
                                        </label>
                                        <div class="pull-right action-buttons">
                                            <a href="#" class="blue"><i class="icon-pencil bigger-130"></i></a><span class="vbar">
                                            </span><a href="#" class="red"><i class="icon-trash bigger-130"></i></a><span class="vbar">
                                            </span><a href="#" class="green"><i class="icon-flag bigger-130"></i></a>
                                        </div>
                                    </li>
                                    <li class="item-default clearfix">
                                        <label class="inline">
                                            <input type="checkbox" class="ace">
                                            <span class="lbl">Adding new features</span>
                                        </label>
                                        <div class="inline pull-right position-relative dropdown-hover">
                                            <button class="btn btn-minier bigger btn-primary">
                                                <i class="icon-cog icon-only bigger-120"></i>
                                            </button>
                                            <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-caret dropdown-close pull-right">
                                                <li><a href="#" class="tooltip-success" data-rel="tooltip" title="Mark&nbsp;as&nbsp;done">
                                                    <span class="green"><i class="icon-ok bigger-110"></i></span></a></li>
                                                <li><a href="#" class="tooltip-error" data-rel="tooltip" title="Delete"><span class="red">
                                                    <i class="icon-trash bigger-110"></i></span></a></li>
                                            </ul>
                                        </div>
                                    </li>
                                    <li class="item-blue clearfix">
                                        <label class="inline">
                                            <input type="checkbox" class="ace">
                                            <span class="lbl">Upgrading scripts used in template</span>
                                        </label>
                                    </li>
                                    <li class="item-grey clearfix">
                                        <label class="inline">
                                            <input type="checkbox" class="ace">
                                            <span class="lbl">Adding new skins</span>
                                        </label>
                                    </li>
                                    <li class="item-green clearfix">
                                        <label class="inline">
                                            <input type="checkbox" class="ace">
                                            <span class="lbl">Updating server software up</span>
                                        </label>
                                    </li>
                                    <li class="item-pink clearfix">
                                        <label class="inline">
                                            <input type="checkbox" class="ace">
                                            <span class="lbl">Cleaning up</span>
                                        </label>
                                    </li>
                                </ul>
                            </div>
                            <div id="member-tab" class="tab-pane">
                                <div class="clearfix">
                                    <div class="itemdiv memberdiv">
                                        <div class="user">
                                            <img alt="Bob Doe's avatar" src="assets/avatars/user.jpg" tppabs="http://192.69.216.111/themes/preview/ace/assets/avatars/user.jpg">
                                        </div>
                                        <div class="body">
                                            <div class="name">
                                                <a href="#">Bob Doe</a>
                                            </div>
                                            <div class="time">
                                                <i class="icon-time"></i><span class="green">20 min</span>
                                            </div>
                                            <div>
                                                <span class="label label-warning label-sm">pending</span>
                                                <div class="inline position-relative">
                                                    <button class="btn btn-minier bigger btn-yellow btn-no-border dropdown-toggle" data-toggle="dropdown">
                                                        <i class="icon-angle-down icon-only bigger-120"></i>
                                                    </button>
                                                    <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
                                                        <li><a href="#" class="tooltip-success" data-rel="tooltip" title="Approve"><span
                                                            class="green"><i class="icon-ok bigger-110"></i></span></a></li>
                                                        <li><a href="#" class="tooltip-warning" data-rel="tooltip" title="Reject"><span class="orange">
                                                            <i class="icon-remove bigger-110"></i></span></a></li>
                                                        <li><a href="#" class="tooltip-error" data-rel="tooltip" title="Delete"><span class="red">
                                                            <i class="icon-trash bigger-110"></i></span></a></li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="itemdiv memberdiv">
                                        <div class="user">
                                            <img alt="Joe Doe's avatar" src="assets/avatars/avatar2.png" tppabs="http://192.69.216.111/themes/preview/ace/assets/avatars/avatar2.png">
                                        </div>
                                        <div class="body">
                                            <div class="name">
                                                <a href="#">Joe Doe</a>
                                            </div>
                                            <div class="time">
                                                <i class="icon-time"></i><span class="green">1 hour</span>
                                            </div>
                                            <div>
                                                <span class="label label-warning label-sm">pending</span>
                                                <div class="inline position-relative">
                                                    <button class="btn btn-minier bigger btn-yellow btn-no-border dropdown-toggle" data-toggle="dropdown">
                                                        <i class="icon-angle-down icon-only bigger-120"></i>
                                                    </button>
                                                    <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
                                                        <li><a href="#" class="tooltip-success" data-rel="tooltip" title="Approve"><span
                                                            class="green"><i class="icon-ok bigger-110"></i></span></a></li>
                                                        <li><a href="#" class="tooltip-warning" data-rel="tooltip" title="Reject"><span class="orange">
                                                            <i class="icon-remove bigger-110"></i></span></a></li>
                                                        <li><a href="#" class="tooltip-error" data-rel="tooltip" title="Delete"><span class="red">
                                                            <i class="icon-trash bigger-110"></i></span></a></li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="itemdiv memberdiv">
                                        <div class="user">
                                            <img alt="Jim Doe's avatar" src="assets/avatars/avatar.png" tppabs="http://192.69.216.111/themes/preview/ace/assets/avatars/avatar.png">
                                        </div>
                                        <div class="body">
                                            <div class="name">
                                                <a href="#">Jim Doe</a>
                                            </div>
                                            <div class="time">
                                                <i class="icon-time"></i><span class="green">2 hour</span>
                                            </div>
                                            <div>
                                                <span class="label label-warning label-sm">pending</span>
                                                <div class="inline position-relative">
                                                    <button class="btn btn-minier bigger btn-yellow btn-no-border dropdown-toggle" data-toggle="dropdown">
                                                        <i class="icon-angle-down icon-only bigger-120"></i>
                                                    </button>
                                                    <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
                                                        <li><a href="#" class="tooltip-success" data-rel="tooltip" title="Approve"><span
                                                            class="green"><i class="icon-ok bigger-110"></i></span></a></li>
                                                        <li><a href="#" class="tooltip-warning" data-rel="tooltip" title="Reject"><span class="orange">
                                                            <i class="icon-remove bigger-110"></i></span></a></li>
                                                        <li><a href="#" class="tooltip-error" data-rel="tooltip" title="Delete"><span class="red">
                                                            <i class="icon-trash bigger-110"></i></span></a></li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="itemdiv memberdiv">
                                        <div class="user">
                                            <img alt="Alex Doe's avatar" src="assets/avatars/avatar5.png" tppabs="http://192.69.216.111/themes/preview/ace/assets/avatars/avatar5.png">
                                        </div>
                                        <div class="body">
                                            <div class="name">
                                                <a href="#">Alex Doe</a>
                                            </div>
                                            <div class="time">
                                                <i class="icon-time"></i><span class="green">3 hour</span>
                                            </div>
                                            <div>
                                                <span class="label label-danger label-sm">blocked</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="itemdiv memberdiv">
                                        <div class="user">
                                            <img alt="Bob Doe's avatar" src="assets/avatars/avatar2.png" tppabs="http://192.69.216.111/themes/preview/ace/assets/avatars/avatar2.png">
                                        </div>
                                        <div class="body">
                                            <div class="name">
                                                <a href="#">Bob Doe</a>
                                            </div>
                                            <div class="time">
                                                <i class="icon-time"></i><span class="green">6 hour</span>
                                            </div>
                                            <div>
                                                <span class="label label-success label-sm arrowed-in">approved</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="itemdiv memberdiv">
                                        <div class="user">
                                            <img alt="Susan's avatar" src="assets/avatars/avatar3.png" tppabs="http://192.69.216.111/themes/preview/ace/assets/avatars/avatar3.png">
                                        </div>
                                        <div class="body">
                                            <div class="name">
                                                <a href="#">Susan</a>
                                            </div>
                                            <div class="time">
                                                <i class="icon-time"></i><span class="green">yesterday</span>
                                            </div>
                                            <div>
                                                <span class="label label-success label-sm arrowed-in">approved</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="itemdiv memberdiv">
                                        <div class="user">
                                            <img alt="Phil Doe's avatar" src="assets/avatars/avatar4.png" tppabs="http://192.69.216.111/themes/preview/ace/assets/avatars/avatar4.png">
                                        </div>
                                        <div class="body">
                                            <div class="name">
                                                <a href="#">Phil Doe</a>
                                            </div>
                                            <div class="time">
                                                <i class="icon-time"></i><span class="green">2 days ago</span>
                                            </div>
                                            <div>
                                                <span class="label label-info label-sm arrowed-in arrowed-in-right">online</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="itemdiv memberdiv">
                                        <div class="user">
                                            <img alt="Alexa Doe's avatar" src="assets/avatars/avatar1.png" tppabs="http://192.69.216.111/themes/preview/ace/assets/avatars/avatar1.png">
                                        </div>
                                        <div class="body">
                                            <div class="name">
                                                <a href="#">Alexa Doe</a>
                                            </div>
                                            <div class="time">
                                                <i class="icon-time"></i><span class="green">3 days ago</span>
                                            </div>
                                            <div>
                                                <span class="label label-success label-sm arrowed-in">approved</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="center">
                                    <i class="icon-group icon-2x green"></i>&nbsp; <a href="#">See all members &nbsp; <i
                                        class="icon-arrow-right"></i></a>
                                </div>
                                <div class="hr hr-double hr8">
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /widget-main -->
                </div>
                <!-- /widget-body -->
            </div>
        </div>
        <!-- /.row -->
    </div>
    <!-- /.page-content -->
</div>